package com.mydesignpattern.beijing.command;

import com.mydesignpattern.beijing.command.command.AirConditionCommand;
import com.mydesignpattern.beijing.command.command.LightCommand;
import com.mydesignpattern.beijing.command.command.TelevisionCommand;
import com.mydesignpattern.beijing.command.receiver.Aircondition;
import com.mydesignpattern.beijing.command.receiver.Light;
import com.mydesignpattern.beijing.command.receiver.Television;

/**
 * 客户端模拟调用
 */
public class Client {


    public static void main(String[] args) {

        //相当于遥控器
        Invoker invoker = new Invoker();
        //相当于加入点灯跟空调的驱动
        //实际情况中，这里的Command可能是别地方传过来的，并不知道具体是哪种command
        invoker.addCommand(new AirConditionCommand(new Aircondition()));
        invoker.addCommand(new LightCommand(new Light()));
        invoker.sleep();

        //加入电视驱动
        invoker.setCommand(new TelevisionCommand(new Television()));
        invoker.on();


    }







}
